﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DrawFunction78 : MonoBehaviour {
	public DrawLine drawLine;
	public float interval;
	public List<Vector2> pointList = new List<Vector2>();

	private float x;
	private float y;
	// Start is called before the first frame update
	void Start() {
		GenerateFunctionPointList();
		drawLine.UpdateLine();
	}

	// Update is called once per frame
	void Update() {

	}

	private void GenerateFunctionPointList() {
		pointList.Clear();
		for (int i = 1; i * interval < 6; i++) {
			x = i * interval;
			y = Mathf.Sin(x) / x * MainControler.Instance.yAxisMagnification;
			pointList.Add(new Vector2(x, y));
		}
		drawLine.pointList = pointList;
	}

}
